@extends('layouts.app')
@section('title', ($bool = isset($info['id'])) ? '编辑权限' : '添加权限')

@section('content')
    <div class="tabs center-block">
        @if ($bool)
            <form class="form-horizontal"  id="addForm" role="form" action="{{ route('permissions.update', [$info]) }}" method="post"></form>
            {{ method_field('PUT') }}
        @else
            <form class="form-horizontal"  id="addForm" role="form" action="{{ route('permissions.store') }}" method="post">
        @endif
            <div class="form-group">
                <label for="name" class="col-sm-4 control-label">权限名称（不可更改）</label>
                <div class="col-sm-6">
                    <input type="text" class="form-control"  name="name" id="name" value="{{ $info->name or '' }}" @if($bool) disabled @endif>
                </div>
            </div>
            <div class="form-group">
                <label for="desc_name" class="col-sm-4 control-label">权限别名</label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" id="desc_name" name="desc_name" value="{{ $info->desc_name or '' }}">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-4 col-sm-8">
                    <button type="submit" class="btn btn-default btn-primary">
                        @if($bool)
                            编辑
                        @else
                            添加
                        @endif
                    </button>
                </div>
            </div>
            {{ csrf_field() }}
        </form>
    </div>
    <link rel="stylesheet" type="text/css"  href="{{ asset('css/users/create.css') }}"/>
@endsection
